package com.shushan.accessibility;

import android.accessibilityservice.AccessibilityService;
import android.util.Log;
import android.view.accessibility.AccessibilityEvent;

/**
 * @ClassName: AccessibilityPermissionService
 * @Desciption: 权限辅助服务
 * @author: yichaohua
 * @date: 2018-07-03
 */
public class AccessibilityPermissionService extends AccessibilityService {

    private static final String TAG = "AccessibilityPermissionService";

    @Override
    public void onAccessibilityEvent(AccessibilityEvent event) {
        // 此方法是在主线程中回调过来的，所以消息是阻塞执行的
        // 获取包名
        CharSequence pkgName = event.getPackageName();
        int eventType = event.getEventType();
        AccessibilityOperator.getInstance().updateEvent(this, event);

        Log.i(TAG,"eventType: " + eventType + " pkgName: " + pkgName);

    }

    @Override
    public void onInterrupt() {

    }

}
